<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">

	<!-- 根元素  -->
	<xsl:template match="/">
		<xsl:apply-templates select="dayReport" />
	</xsl:template>

	<!--主模板//-->
	<xsl:template match="dayReport">
		<xsl:processing-instruction name="cocoon-format">type="text/xslfo"</xsl:processing-instruction>
		<!--在此可以定义一些全局的风格信息，如字体等-->
		<fo:root font-family="SimSun" xmlns:fo="http://www.w3.org/1999/XSL/Format">
			<!--版面定义//-->
			<fo:layout-master-set>
				<fo:simple-page-master page-width="20cm" page-height="25cm" master-name="main" margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm">
					<!--主体//-->
					<fo:region-body margin-top="1cm" margin-bottom="1cm" />
					<!--页脚//-->
					<fo:region-after extent="1cm" />
				</fo:simple-page-master>
			</fo:layout-master-set>

			<fo:page-sequence master-reference="main">
				<!--页脚显示内容-->
				<fo:static-content flow-name="xsl-region-after">
					<fo:block line-height="10pt" font-size="10pt" text-align="center">
						共<fo:page-number-citation ref-id="endofdoc"/>页<xsl:text>       </xsl:text>第<fo:page-number/>页
					</fo:block>
				</fo:static-content>
				<!--页面主体内容-->
				<fo:flow flow-name="xsl-region-body">
					<!--报表头-->
					<xsl:apply-templates select="ReportHeader" />
					<xsl:apply-templates select="ReportTime" />
					<!--报表体(若有多个部分内容，参照下面一行重复)-->
					<xsl:apply-templates select="ReportBody" />
					<xsl:apply-templates select="ReportWeather" />
					
					<xsl:apply-templates select="WeekCompleteWork1" />
					
					<xsl:apply-templates select="WeekCompleteWork" />
					
					<xsl:apply-templates select="reportConstructSchedule1" />
					
					<xsl:apply-templates select="reportConstructSchedule" />
					
					<xsl:apply-templates select="reportMaterial1" />
					
					<xsl:apply-templates select="reportMaterial" />
					
					<xsl:apply-templates select="weekly" />
					
					<xsl:apply-templates select="people" />
					
					<!--报表尾-->
					<xsl:apply-templates select="ReportFooter" />
				</fo:flow>
			</fo:page-sequence>
		</fo:root>
	</xsl:template>
	
	<!--报表尾//-->
	<xsl:template match="ReportFooter">
			<fo:block id="endofdoc"></fo:block>
	</xsl:template>

	<!--报表头//-->
	<xsl:template match="ReportHeader">
		<fo:block font-size="16pt" font-weight="bold" text-align="center" space-before.optimum="10pt"></fo:block>
		<fo:block font-size="16pt" space-before="2mm" space-after="2mm">
			<fo:table table-layout="fixed" text-align="center">
		 	 		<fo:table-column column-width="30%"></fo:table-column>
		 	 		<fo:table-column column-width="50%"></fo:table-column>
    				<fo:table-body>
    					<fo:table-row>
    					    <fo:table-cell><fo:block><xsl:value-of select="Title/RemouldProjectName"/></fo:block></fo:table-cell>
    						<fo:table-cell><fo:block><xsl:text>工程施工情况日报表</xsl:text></fo:block></fo:table-cell>
    					</fo:table-row>
    				</fo:table-body>
       			</fo:table>
		</fo:block>
	</xsl:template>
	<!-- 报告日期 -->
	<xsl:template match="ReportTime">
		<fo:block font-size="14pt" font-weight="bold" text-align="center" space-before.optimum="10pt"></fo:block>
		<fo:block font-size="14pt" space-before="2mm" space-after="2mm">
			<fo:table table-layout="fixed" text-align="center">
		 	 		<fo:table-column column-width="20%"></fo:table-column>
		 	 		<fo:table-column column-width="10%"></fo:table-column>
		 	 		<fo:table-column column-width="5%"></fo:table-column>
		 	 		<fo:table-column column-width="10%"></fo:table-column>
		 	 		<fo:table-column column-width="5%"></fo:table-column>
		 	 		<fo:table-column column-width="10%"></fo:table-column>
					<fo:table-column column-width="5%"></fo:table-column>
					<fo:table-column column-width="10%"></fo:table-column>
		 	 		<fo:table-column column-width="10%"></fo:table-column>
		 	 		<fo:table-column column-width="15%"></fo:table-column>
    				<fo:table-body>
    					<fo:table-row>
    						<fo:table-cell><fo:block><xsl:text>施工日期</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell><fo:block><xsl:value-of select="Time/Year"/></fo:block></fo:table-cell>
    						<fo:table-cell><fo:block><xsl:text>年</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell><fo:block><xsl:value-of select="Time/Month"/></fo:block></fo:table-cell>
    						<fo:table-cell><fo:block><xsl:text>月</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell><fo:block><xsl:value-of select="Time/Day"/></fo:block></fo:table-cell>
    						<fo:table-cell><fo:block><xsl:text>日</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell><fo:block><xsl:text>        </xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell><fo:block><xsl:text>编号：</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell><fo:block><xsl:value-of select="Time/SerialNum"/></fo:block></fo:table-cell>
    					</fo:table-row>
    				</fo:table-body>
       			</fo:table>
		</fo:block>
	</xsl:template>
	<!-- 报表天气 -->
	<xsl:template match="ReportWeather">
		<fo:block>
       			<fo:table table-layout="fixed" border-color="black" border-width="0.8pt" border-style="solid" font-size="12pt" vertical-align="middle">
		 	 		<fo:table-column column-width="15%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
		 	 		<fo:table-column column-width="85%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
    				<fo:table-body>
    					<fo:table-row line-height="12pt" border-color="black" border-width="0.4pt" border-style="solid">
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>项目</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>内容</xsl:text></fo:block></fo:table-cell>
						</fo:table-row>
						<fo:table-row line-height="12pt" border-color="black" border-width="0.4pt" border-style="solid">
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>天气</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>晴：</xsl:text><xsl:value-of select="Weather/Sun"/><xsl:text>天</xsl:text>
    						<xsl:text>阴：</xsl:text><xsl:value-of select="Weather/Cloudy"/><xsl:text>天</xsl:text>
    						<xsl:text>雨：</xsl:text><xsl:value-of select="Weather/Rain"/><xsl:text>天</xsl:text>
    						</fo:block></fo:table-cell>
						</fo:table-row>
					</fo:table-body>
       			</fo:table>
		</fo:block>
	</xsl:template>
	<!-- 今天完成情况 -->

	<xsl:template match="WeekCompleteWork1">
	<fo:block font-size="14pt" font-weight="bold"  text-align="center" space-before.optimum="10pt"></fo:block>
		<fo:block font-size="14pt" font-weight="bold"  space-before.optimum="10pt"><xsl:value-of select="Title" /></fo:block>
		
	</xsl:template>
	<xsl:template match="WeekCompleteWork">
		<fo:block>
				<fo:table table-layout="fixed" border-color="black" border-width="0.8pt" border-style="solid" font-size="12pt" vertical-align="middle">
		 	 		<fo:table-column column-width="10%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
		 	 		<fo:table-column column-width="15%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
		 	 		<fo:table-column column-width="20%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
		 	 		<fo:table-column column-width="20%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
		 	 		<fo:table-column column-width="10%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
		 	 		<fo:table-column column-width="10%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
		 	 		<fo:table-column column-width="15%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
    				<fo:table-body>
    					<fo:table-row line-height="12pt" border-color="black" border-width="0.4pt" border-style="solid">
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>序号</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>项目名称</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>施工内容</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>分包单位</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>本日计划完成工程量%</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>本日实际完成工程量%</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>备注</xsl:text></fo:block></fo:table-cell>
    						
    					</fo:table-row>
    				
    					
    					<xsl:for-each select="Record">
    						<fo:table-row line-height="12pt" font-size="12pt" border-color="black" border-width="0.4pt" border-style="solid">
    							<fo:table-cell text-align="center"><fo:block><xsl:value-of select="number"/></fo:block></fo:table-cell>
    							<fo:table-cell text-align="center"><fo:block><xsl:value-of select="remouldProjectName"/></fo:block></fo:table-cell>
    							<fo:table-cell text-align="center"><fo:block><xsl:value-of select="constructContent"/></fo:block></fo:table-cell>
    							<fo:table-cell text-align="center"><fo:block><xsl:value-of select="constructUnit"/></fo:block></fo:table-cell>
    							<fo:table-cell text-align="center"><fo:block><xsl:value-of select="plannCompleteWork"/></fo:block></fo:table-cell>
    							<fo:table-cell text-align="center"><fo:block><xsl:value-of select="actualCompleteWork"/></fo:block></fo:table-cell>
    							<fo:table-cell text-align="center"><fo:block><xsl:value-of select="comment"/></fo:block></fo:table-cell>
    						</fo:table-row>
      					</xsl:for-each>

    				</fo:table-body>
       			</fo:table>
		</fo:block>
	</xsl:template>
	
	
	<!-- 下一天计划 -->
	<xsl:template match="reportConstructSchedule1">
	<fo:block font-size="14pt" font-weight="bold"  text-align="center" space-before.optimum="10pt"></fo:block>
	<fo:block font-size="14pt" font-weight="bold"  space-before.optimum="10pt"><xsl:value-of select="Title" /></fo:block>
		
	</xsl:template>
	
	<xsl:template match="reportConstructSchedule">
		<fo:block font-size="12pt" font-weight="bold"  >
		<fo:table table-layout="fixed" border-color="black" border-width="0.8pt" border-style="solid" font-size="12pt" vertical-align="middle" >
		 	 		<fo:table-column column-width="40%"></fo:table-column>
		 	 		<fo:table-column column-width="15%"></fo:table-column>
		 	 		<fo:table-column column-width="15%"></fo:table-column>
		 	 		<fo:table-column column-width="15%"></fo:table-column>
		 	 		<fo:table-column column-width="15%"></fo:table-column>
    				<fo:table-body>
    					<fo:table-row>
    						<fo:table-cell><fo:block><xsl:text>下一天施工计划（</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell><fo:block><xsl:value-of select="Time/Month1"/></fo:block></fo:table-cell>
    						<fo:table-cell><fo:block><xsl:text>月</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell><fo:block><xsl:value-of select="Time/Day1"/></fo:block></fo:table-cell>
    						<fo:table-cell><fo:block><xsl:text>日）</xsl:text></fo:block></fo:table-cell>
    					</fo:table-row>
    				</fo:table-body>
       			</fo:table>
		</fo:block>
		<fo:block>
				<fo:table table-layout="fixed" border-color="black" border-width="0.8pt" border-style="solid" font-size="12pt" vertical-align="middle">
		 	 		<fo:table-column column-width="50%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
		 	 		<fo:table-column column-width="50%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
    				<fo:table-body>
    					<fo:table-row line-height="12pt" border-color="black" border-width="0.4pt" border-style="solid">
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>施工内容</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>截至时间</xsl:text></fo:block></fo:table-cell>
    						
    					</fo:table-row>
    				
    					
    					<xsl:for-each select="Record">
    						<fo:table-row line-height="12pt" font-size="12pt" border-color="black" border-width="0.4pt" border-style="solid">
    							<fo:table-cell text-align="center"><fo:block><xsl:value-of select="processNumber"/></fo:block></fo:table-cell>
    							<fo:table-cell text-align="center"><fo:block><xsl:value-of select="cutOffDtm"/></fo:block></fo:table-cell>
    						</fo:table-row>
      					</xsl:for-each>

    				</fo:table-body>
       			</fo:table>
		</fo:block>
	</xsl:template>
	
	<!-- 材料 -->
	<xsl:template match="reportMaterial1">
	<fo:block font-size="14pt" font-weight="bold"  text-align="center" space-before.optimum="10pt"></fo:block>
	<fo:block font-size="14pt" font-weight="bold"  space-before.optimum="10pt"><xsl:value-of select="Title" /></fo:block>
	</xsl:template>
	
	<xsl:template match="reportMaterial">
		<fo:block>
				<fo:table table-layout="fixed" border-color="black" border-width="0.8pt" border-style="solid" font-size="12pt" vertical-align="middle">
		 	 		<fo:table-column column-width="10%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
		 	 		<fo:table-column column-width="10%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
		 	 		<fo:table-column column-width="10%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
		 	 		<fo:table-column column-width="10%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
		 	 		<fo:table-column column-width="20%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
		 	 		<fo:table-column column-width="15%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
		 	 		<fo:table-column column-width="10%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
					<fo:table-column column-width="15%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
    				<fo:table-body>
    					<fo:table-row line-height="12pt" border-color="black" border-width="0.4pt" border-style="solid">
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>序号</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>名称</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>供应情况（甲供/乙供）</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>产品合格证（是否具有）</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>生产厂家</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>单位</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>数量</xsl:text></fo:block></fo:table-cell>
							<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>抽检结果</xsl:text></fo:block></fo:table-cell>
    						
    					</fo:table-row>
    				
    					
    					<xsl:for-each select="Record">
    						<fo:table-row line-height="12pt" font-size="12pt" border-color="black" border-width="0.4pt" border-style="solid">
    							<fo:table-cell text-align="center"><fo:block><xsl:value-of select="number"/></fo:block></fo:table-cell>
    							<fo:table-cell text-align="center"><fo:block><xsl:value-of select="name"/></fo:block></fo:table-cell>
    							<fo:table-cell text-align="center"><fo:block><xsl:value-of select="supplySituation"/></fo:block></fo:table-cell>
    							<fo:table-cell text-align="center"><fo:block><xsl:value-of select="certificate"/></fo:block></fo:table-cell>
    							<fo:table-cell text-align="center"><fo:block><xsl:value-of select="manufacturer"/></fo:block></fo:table-cell>
    							<fo:table-cell text-align="center"><fo:block><xsl:value-of select="unit"/></fo:block></fo:table-cell>
    							<fo:table-cell text-align="center"><fo:block><xsl:value-of select="amount"/></fo:block></fo:table-cell>
								<fo:table-cell text-align="center"><fo:block><xsl:value-of select="sampledResult"/></fo:block></fo:table-cell>
    						</fo:table-row>
      					</xsl:for-each>

    				</fo:table-body>
       			</fo:table>
		</fo:block>
	</xsl:template>
	<!-- 周报 -->
	<xsl:template match="weekly">
		<fo:table table-layout="fixed" border-color="black" border-width="0.4pt" border-style="solid" font-size="14pt" vertical-align="middle">
		 	 		<fo:table-column column-width="25%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
		 	 		<fo:table-column column-width="75%" border-color="black" border-width="0.4pt" border-style="solid"></fo:table-column>
    				<fo:table-body>
    					<fo:table-row line-height="14pt" border-color="black" border-width="0.4pt" border-style="solid">
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>本日实际施工部位及形象进度</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:value-of select="actualConstructionSite"/></fo:block></fo:table-cell>
						</fo:table-row>
						<fo:table-row line-height="14pt" border-color="black" border-width="0.4pt" border-style="solid">
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>施工质量、安全文明情况</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:value-of select="safeCivilizeProduct"/></fo:block></fo:table-cell>
						</fo:table-row>
						<fo:table-row line-height="14pt" border-color="black" border-width="0.4pt" border-style="solid">
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>存在的问题及处理措施</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:value-of select="problemTreatMeasure"/></fo:block></fo:table-cell>
						</fo:table-row>
						<fo:table-row line-height="14pt" border-color="black" border-width="0.4pt" border-style="solid">
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>人工数/天</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>管理人员：</xsl:text><xsl:value-of select="ReportPeopleNumber/executive"/><xsl:text>名</xsl:text>
    						<xsl:text>木工：</xsl:text><xsl:value-of select="ReportPeopleNumber/woodworker"/><xsl:text>名</xsl:text>
    						<xsl:text>瓦工：</xsl:text><xsl:value-of select="ReportPeopleNumber/bricklayer"/><xsl:text>名</xsl:text>
							<xsl:text>安装工： </xsl:text><xsl:value-of select="ReportPeopleNumber/installer"/><xsl:text>名</xsl:text>
							<xsl:text>其他： </xsl:text><xsl:value-of select="ReportPeopleNumber/other"/><xsl:text>名</xsl:text>
							</fo:block></fo:table-cell>
						</fo:table-row>
						<fo:table-row line-height="14pt" border-color="black" border-width="0.4pt" border-style="solid">
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:text>大事记</xsl:text></fo:block></fo:table-cell>
    						<fo:table-cell text-align="center" number-columns-spanned="1"><fo:block><xsl:value-of select="ReportChronicle/content"/></fo:block></fo:table-cell>
						</fo:table-row>
					</fo:table-body>
       	</fo:table>
	</xsl:template>
	
	<!-- 编制人-->
	<xsl:template match="people">
	<fo:block font-size="14pt" font-weight="bold" text-align="center" space-before.optimum="10pt"></fo:block>
		<fo:block font-size="14pt" space-before="2mm" space-after="2mm">
			<fo:table table-layout="fixed" text-align="left">
		 	 		<fo:table-column column-width="30%"></fo:table-column>
		 	 		<fo:table-column column-width="30%"></fo:table-column>
    				<fo:table-body>
    					<fo:table-row>
							<fo:table-cell><fo:block><xsl:text>编制人：</xsl:text></fo:block></fo:table-cell>
    					    <fo:table-cell><fo:block><xsl:value-of select="creatByName"/></fo:block></fo:table-cell>
    						
    					</fo:table-row>
    				</fo:table-body>
       			</fo:table>
		</fo:block>
	</xsl:template>
</xsl:stylesheet>